﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLCMS.Data.Model;
using ZLCMS.Business.Util;
using NHibernate;
using ZLCMS.Business;
using NHibernate.Criterion;

namespace ZLCMS.Web.SystemManage.weixin.Material
{
    public partial class TextMaterialView : System.Web.UI.Page
    {
        protected WxMaterialText _newDb;//当前分类

        protected string _userAccount;

        protected void Page_Load(object sender, EventArgs e)
        {
            _userAccount = UserKit.GetUserAccountFailLogin();

            using (ISession session = DotNet.Common.NHibernateUtil.SessionFactoryHelper.CreateSession())
            {
                _newDb = session.CreateCriteria<WxMaterialText>().Add(Expression.Eq("OwnerAccount", _userAccount)).Add(Expression.Eq("Id", int.Parse(Request["uid"]))).UniqueResult<WxMaterialText>();
            }

            if (_newDb == null)
            {
                _newDb = new WxMaterialText();
            }
        }
    }
}